package com.pb.infra.auth.mapper.custom;

import com.pb.infra.oth.entity.common.Tree;
import com.pb.infra.auth.entity.custom.PriviRoleCustom;
import com.pb.infra.auth.entity.custom.PriviUserCustom;
import com.pb.infra.auth.entity.pbsys.PriviRole;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 角色管理
 *
 * @author liudebao
 * @date 2020/1/1
 */
@Mapper
@Repository
public interface PriviRoleCustomMapper {

    /**
     * 查询角色
     *
     * @param condition
     * @return List<PriviRoleCustom>
     */
    List<PriviRoleCustom> select(PriviRoleCustom condition);

    /**
     * 批量删除
     *
     * @param roleIds
     * @return
     */
    int batchDelete(String[] roleIds);

    /**
     * 读取某个角色仍未配置的用户分页信息
     *
     * @param priviUserCustom 请求参数
     * @return List<PriviUserCustom> 某个角色仍未配置的用户信息
     */
    List<PriviUserCustom> getRoleUserNotMapListByPage(PriviUserCustom priviUserCustom);


    /**
     * 读取某个角色配置的菜单信息
     *
     * @param paramMap 请求参数
     * @return List<Tree> 某个角色配置的菜单信息
     */
    List<Tree> getMenuByRoleId(Map<String, Object> paramMap);

    /**
     * 读取某角色配置的用户分页信息
     * @param paramMap
     * @return
     */
    List<Map<String, Object>> getRoleUserListByPage(Map<String, Object> paramMap);

    /**
     * 查询某法人所有角色
     * @param paramMap
     * @return
     */
    List<Map<String, Object>> selAllRole(Map<String, Object> paramMap);

    /**
     * 通过角色名称查询角色信息
     * @param priviRole
     * @return
     */
    List<Map<String, Object>> selRoleNameInfo(PriviRole priviRole);

    void addBtnRes(Map<String, Object> paramMap);

    List<Map<String, Object>> queryMenuInter(Map<String, Object> paramMap);

    List<Map<String, Object>> queryRoleInterRes(Map<String, Object> map);

    List<Map<String, Object>> queryMenuInterRes(Map<String, Object> map);

    List<Map<String, Object>> queryAllMenu(String appId);

    void delRoleInter(Map<String, Object> map);

    void delSingleRoleInter(Map<String, Object> map);

    void addRoleInter(Map<String, Object> map);

    List<Map<String, Object>> queryBtnRes(Map<String, Object> map);

    void delRoleMenuInter(Map<String, Object> map);

    void addRoleMenuInter(Map<String, Object> map);

    void delRoleRes(String roleId);

    List<Map<String, Object>> selPosRoleByInfo(Map<String, Object> map);

}
